package org.example.demos.pattern.chain_pattern_reference;

import lombok.Data;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 校验上下文
 */
@Data
public class CheckContext {
 
    /**
     * 存储各Checker的校验结果 key:check_code
     */
    private Map<String, CheckResult> checkResultMap = new ConcurrentHashMap<>();
 
    public void setResult(String checkerName, CheckResult checkResult) {
        checkResultMap.put(checkerName, checkResult);
    }
 
}